#include "stm32f4xx_hal.h"

typedef enum {
	Stop = 0,
	Go,
	Back,
	Left,
	Right,
	Go_R_L,
	Go_R_H,
	Go_R_M,
	Go_L_L,
	Go_L_H,
	Go_L_M,
	Back_R_L,
	Back_R_H,
	Back_R_M,
	Back_L_L,
	Back_L_H,
	Back_L_M,
} ctrl_operat;

typedef struct {
	double ch_mb;
	double ch_lr;
} ch_pwm;
extern ch_pwm ch_pwm_value;

/*定义轮子三种运行状态*/
typedef enum {
	stop = 0, forward, backward,
} run_wheel;
typedef struct {
	run_wheel left;
	run_wheel right;
} run_collection;
typedef struct {
	ctrl_operat operation;
	run_collection wheel;
} ctrl_collection;

uint8_t
pwm_value_set(TIM_HandleTypeDef *htim, uint32_t Channel, uint32_t pwm_value);
uint8_t creat_operate_data(uint8_t operate_type);
uint8_t
pwm_value(double rx_pwm_mb, double rx_pwm_lr);
void change_check(void);
void
do_run(void);
uint8_t
do_Stop(void);
uint8_t
do_Go(void);
uint8_t
do_Back(void);
uint8_t
do_Left(void);
uint8_t
do_Right(void);
uint8_t
do_Go_R_L(void);
uint8_t
do_Go_R_M(void);
uint8_t
do_Go_R_H(void);
uint8_t
do_Back_R_H(void);
uint8_t
do_Back_R_M(void);
uint8_t
do_Back_R_L(void);
uint8_t
do_Back_L_L(void);
uint8_t
do_Back_L_M(void);
uint8_t
do_Back_L_H(void);
uint8_t
do_Go_L_H(void);
uint8_t
do_Go_L_M(void);
uint8_t
do_Go_L_L(void);
